
#include "Custom_config.h"


#ifdef AC209_28PIN

    #ifdef NEW_28PIN_IO_DEFINE
             #ifdef  MUTE_PORT_USE_P00
	                #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P0DIR &= ~0x01      //P0IE &= 0xfe;//P3DIR &= ~0x10//
			 #define SET_MUTE_PORT_PU() 			P0PU |= 0x01//P3PU |= 0x10//
	               #ifdef  PA_LOW_MUTE//
	               #define MUTE_PORT_HIGH()			P00  =0//P34=1//
	               #define MUTE_PORT_LOW()			P00  =1//	P34  =0//
	               #else
	               #define MUTE_PORT_HIGH()			P00  =1//P34=1//
	               #define MUTE_PORT_LOW()			P00  =0//	P34  =0//
	               #endif
			#elif defined(MUTE_PORT_USE_P02)
			 #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P0DIR &=~(1<<2);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
			#define SET_MUTE_PORT_PU() 			P0PU |= (1<<2);//P3PU |= 0x10//
			#define MUTE_PORT_HIGH()			P02  =1//P34=1//
	              #define MUTE_PORT_LOW()			P02  =0//	P34  =0//	   
	              #elif defined(MUTE_PORT_USE_P27)
			 #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &=~(1<<7);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
			#define SET_MUTE_PORT_PU() 			P2PU |= (1<<7);//P3PU |= 0x10//
			 #ifdef  PA_LOW_MUTE//
			 	#define MUTE_PORT_HIGH()			P27  =0//P34=1//
		              #define MUTE_PORT_LOW()			P27  =1//	P34  =0//	  
			 	#else
				#define MUTE_PORT_HIGH()			P27  =1//P34=1//
		              #define MUTE_PORT_LOW()			P27  =0//	P34  =0//	  
	              #endif
							 
		#elif defined(MUTE_PORT_USE_P26)
			 #define SET_MUTE_PORT_DIR()	P2DIR &=~(1<<6);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
			#define SET_MUTE_PORT_PU() 			P2PU |= (1<<6);//P3PU |= 0x10//
			#define MUTE_PORT_HIGH()			P26  =1//P34=1//
	              #define MUTE_PORT_LOW()			P26  =0//	P34  =0//	   
		#else
               #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
                #define SET_MUTE_PORT_PU() 			P2PU |= BIT(6) ///P3PU |= 0x10//

                 #ifdef  PA_LOW_MUTE//
                    #define MUTE_PORT_HIGH()			P26  =0//P34=1//
                    #define MUTE_PORT_LOW()			P26  =1//	P34  =0//
                 #else
                 #define MUTE_PORT_HIGH()			P26  =1//P34=1//
                    #define MUTE_PORT_LOW()			P26  =0//	P34  =0//
                  #endif
                #endif
    
                   #if defined(K136_BAILITONG_CP_99_2) ||defined(K616_YDS)||defined(K616_YDS_WELSE)
                   #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= BIT(7);  P0DIR &= ~BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
                  #define FM_STATUS_PORT  P02
		    #define PLAY_STATUS_PORT P27	  
		    #elif defined(PLAY_STATUS_LED_P00)
		     #define play_led_seg_out()  DACCON0|=0x80;P0DIR &= ~(BIT(0));P0PU |= BIT(0); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
                   #define PLAY_STATUS_PORT P00
		  #elif defined(PLAY_STATUS_LED_P01)
		      #define play_led_seg_out()  DACCON0|=0x80;P0DIR &= ~(BIT(1));P0PU |= BIT(1); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
                   #define PLAY_STATUS_PORT P01
		#elif  defined(PLAY_STATUS_LED_P02)
		  	#define play_led_seg_out()  DACCON0|=0x80;P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
                   #define PLAY_STATUS_PORT P02
		    #elif defined(K3006_FO_UST)
			#define play_led_seg_out()       DACCON0|=0x80;P2DIR &= ~(BIT(4)|BIT(5));P2PU |= BIT(4)|BIT(5);
			#define PLAY_STATUS_PORT   P25   
	              #define FM_STATUS_PORT  P24
		    #elif defined(K3005_F2_UST)
			#define play_led_seg_out()       DACCON0|=0x80;P2DIR &= ~(BIT(7)|BIT(5));P2PU |= BIT(7)|BIT(5);
			#define PLAY_STATUS_PORT   P25
	              #define FM_STATUS_PORT  P27	  
                  #else
	                   #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= BIT(7); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
	                   #define PLAY_STATUS_PORT P27
                     #endif
#if defined(HY1205_813_JLH)||defined(K3009_QY_168_SES)||defined(K3012_YY2091_DY450)||defined(FD_35_NEW_LIANSHENG)
    #define iic_data_out()    P0DIR &= ~(BIT(2));P0PU |= (BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); ;
   #define iic_data_in()     P0DIR |= (BIT(2));P0PU |= (BIT(2));
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0

	#else
		#ifdef   IIC_CLK_P01_SDA_P00
		#define iic_data_out()    P0DIR &= ~(1<<0);P0PU |= (1<<0) ;
	    #define iic_data_in()     P0DIR |= (1<<0);P0PU |= (1<<0);
	    #define iic_data_r()      P00
	    #define iic_data_h()      P00 = 1
	    #define iic_data_l()      P00 = 0
	    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1);
	    #define iic_clk_h()      P01 = 1
	    #define iic_clk_l()      P01 = 0
		#else
	    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
	    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
	    #define iic_data_r()      P01
	    #define iic_data_h()      P01 = 1
	    #define iic_data_l()      P01 = 0
	    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
	    #define iic_clk_h()      P00 = 1
	    #define iic_clk_l()      P00 = 0
	   #endif

#endif
			#ifdef USB_PLUGGED_USE_P26  
			       #define  sub_detect_in()   P26=0; DACCON0|=0x80;  P2DIR |= BIT(6);//P2PU|= BIT(6);
                       #define  USB_DETECT_GPIO  P26
                       #define  usb_detect_in_off()        P2DIR &= ~BIT(6); //linein check port
                      #elif  defined(USB_PLUGGED_USE_P24)
			   #define  sub_detect_in()   P24=0; DACCON0|=0x40;  P2DIR |= BIT(4);//P2PU|= BIT(6);
                       #define  USB_DETECT_GPIO  P24
                       #define  usb_detect_in_off()        P2DIR &= ~BIT(4); //linein check port		   
			#endif
			#ifdef  USE_LINE_IN_DETECT_FUNC
			 #ifdef LINE_IN_DETECT_USE_P27
                       #define  aux_detect_in()    DACCON0|=0x80;  P2DIR |= BIT(7);P2PU |= BIT(7);
                       #define  AUX_DETECT_GPIO  P27
                       #define  aux_detect_in_off()        P2DIR &= ~BIT(7); //linein check port
                      #elif defined(LINE_IN_DETECT_USE_P05)
                        #define  aux_detect_in()    P0DIR |= BIT(5);P0PU |= BIT(5);
                       #define  AUX_DETECT_GPIO  P05
                       #define  aux_detect_in_off()        P0DIR &= ~BIT(5); //linein check port
			#elif defined(LINE_IN_DETECT_USE_P01)
			#define  aux_detect_in()      P0DIR |= BIT(1);P0PU |= BIT(1);//linein check port
			#define  AUX_DETECT_GPIO  P01
			#define  aux_detect_in_off()        P0DIR &= ~BIT(1); //linein check port
			#else
			#ifndef  HY1205_813_JLH
                       #define  aux_detect_in()      P0DIR |= BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);//linein check port
                       #define  AUX_DETECT_GPIO  P02
                       #define  aux_detect_in_off()        P0DIR &= ~BIT(2); //linein check port
                      #endif
                      #endif
                       #endif
			
                      #ifdef    EARPHONE_PLUGGED_USE_P02
                      #define   EARPHONE_DETECT_GPIO  P02
                      #define   earphone_detect_in()   P0DIR |= BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);					   
			#elif    defined(EARPHONE_PLUGGED_USE_P24)
			  #define   EARPHONE_DETECT_GPIO  P24
                      #define   earphone_detect_in()   DACCON0|=0x40;P2DIR |= BIT(4);P2PU |= BIT(4);	
			#elif    defined(EARPHONE_PLUGGED_USE_P26)
			  #define   EARPHONE_DETECT_GPIO  P26
                      #define   earphone_detect_in()   DACCON0|=0x40;P2DIR |= BIT(6);P2PU |= BIT(6);	
			#else
                      #define   EARPHONE_DETECT_GPIO  P27
                      #define   earphone_detect_in()   DACCON0|=0x80;P2DIR |= 0x80;P2PU &= ~0x80; 
                      #endif
				#ifdef POWER_POWRE_KEY_VPP	
				#define power_key_detect_in()	DACCON0|=0x80; WKUPPND |= (1<<6); 	// P0DIR |=(1<<2); P0PU &=~(1<<2);P0PD|=(1<<2);      //P0IE &= 0xfe;//P3DIR &= ~0x10//
				#define POWER_KEY_PORT		(WKUPPND & BIT(7))
				#else
                         #define power_key_detect_in()		DACCON0|=0x80; P2DIR &=~(1<<7);P2PU |= (1<<7);P27 =1;;P2DIR |= (1<<7);P2PU &= ~(1<<7);
                         #define POWER_KEY_PORT		P27//P34=1//
                         #endif
			#ifdef  POWER_SAVE_SYSTEM
			
			        #if defined( POWER_CTL_P02)	
				#define power_ctl(n)    DACCON0|=0x80; P0DIR &=~(1<<2); P0PU|=(1<<2);  P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n	
				#else
                         	#define power_ctl(n)  	 P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n	
				#endif
                     #endif
      #elif defined(K1039_LHGC3)||defined(K1039_ZK)//#ifdef 
                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(2) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P02  =1//P34=1//
                         #define MUTE_PORT_LOW()			P02  =0//	P34  =0//                        
                           #define play_led_seg_out()   P0DIR &= ~(BIT(0));P0PU |= (BIT(0)); 
                         #define PLAY_STATUS_PORT  P00
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()      P00 = 1
    #define iic_clk_l()      P00 = 0

					 
      #elif defined(K761_jiaxingda)//#ifdef 
                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(2) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P02  =0//P34=1//
                         #define MUTE_PORT_LOW()			P02  =1//	P34  =0//                        
                           #define play_led_seg_out()   DACCON0|=0x40; P2DIR &= ~(BIT(5));P0PU |= (BIT(5)); 
                         #define PLAY_STATUS_PORT  P25
    #define iic_data_out()    P0DIR &= ~(1);P0PU |= (1) ;
    #define iic_data_in()     P0DIR |= (1);P0PU |= (1);
    #define iic_data_r()      P00
    #define iic_data_h()      P00 = 1
    #define iic_data_l()      P00 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0
	      #elif defined(K806_GAOSHENG)//#ifdef 
     #define SET_MUTE_PORT_DIR()	DACCON0|=0x40;P2DIR &= ~(BIT(4))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 			P2PU |= BIT(4) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()		P24=1;//	P02  =1//P34=1//
                         #define MUTE_PORT_LOW()		P24=0;//P02  =0//	P34  =0//                        
                           #define play_led_seg_out() P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<2);
                         #define PLAY_STATUS_PORT  P02
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()      P00 = 1
    #define iic_clk_l()      P00 = 0
#elif defined(k1023_MY_XY)
		                          #define SET_MUTE_PORT_DIR()	;//P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	;//P0PU |= BIT(2) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()		;//	P02  =1//P34=1//
                         #define MUTE_PORT_LOW()			;//P02  =0//	P34  =0//      
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()      P00 = 1
    #define iic_clk_l()      P00 = 0
   #define power_ctl(n)  	 P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n	
                   #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= BIT(7); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
                   #define PLAY_STATUS_PORT P27
#elif defined(OK_514D)
    #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 			P2PU |= BIT(6) ///P3PU |= 0x10//

          #define MUTE_PORT_HIGH()			P26  =1//P34=1//
              #define MUTE_PORT_LOW()			P26  =0//	P34  =0//			  
                           #define play_led_seg_out() P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
                         #define PLAY_STATUS_PORT  P02
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()      P00 = 1
    #define iic_clk_l()      P00 = 0
       #define power_ctl(n)  	 DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= (BIT(7));  P27=n	

#elif defined(OKL_514A)//#ifdef 
    #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 			P2PU |= BIT(6) ///P3PU |= 0x10//

          #define MUTE_PORT_HIGH()			P26  =1//P34=1//
              #define MUTE_PORT_LOW()			P26  =0//	P34  =0//			  
               #define play_led_seg_out() P0DIR &= ~(BIT(0)) ;P0PU |= (BIT(0));
               #define PLAY_STATUS_PORT  P00
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()      P00 = 1
    #define iic_clk_l()      P00 = 0
       #define power_ctl(n)  	 DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= (BIT(7));  P27=n	

#elif defined(LS_2091_001)//#ifdef 
                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(0)) ;//P3DIR |= (1<<4);//P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(0) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P00  =1//P34=1//
                         #define MUTE_PORT_LOW()			P00  =0//	P34  =0//                        
 #define play_led_seg_out() DACCON0|=0x80; P2DIR &= ~(BIT(7)) ;P2PU |= (BIT(7)); 
 #define PLAY_STATUS_PORT  P27
 
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_clk_h()      P02= 1
    #define iic_clk_l()      P02 = 0

#define  aux_detect_in()     DACCON0|=0x80; P2DIR |= BIT(6);P2PU |= BIT(6);
 #define  AUX_DETECT_GPIO  P26
 #define  aux_detect_in_off()        P2DIR &= ~BIT(6); //linein check port

	      #elif defined(K1050_DCX_8803)//#ifdef 
                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(2) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P02  =1//P34=1//
                         #define MUTE_PORT_LOW()			P02  =0//	P34  =0//           
                                       #define play_led_seg_out() DACCON0|=0x40;P2DIR &= ~(BIT(5));P2PU |= BIT(5); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);                  
                                       #define PLAY_STATUS_PORT P25
                                       #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
                                       #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
                                       #define iic_data_r()      P01
                                       #define iic_data_h()      P01 = 1
                                       #define iic_data_l()      P01 = 0
                                       
                                       #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
                                       #define iic_clk_h()      P00 = 1
                                       #define iic_clk_l()      P00 = 0
                       
	      #elif defined(K805_GAOSHENG)//#ifdef 

		                          #define SET_MUTE_PORT_DIR()	;//P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	;//P0PU |= BIT(2) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()		;//	P02  =1//P34=1//
                         #define MUTE_PORT_LOW()			;//P02  =0//	P34  =0//                        
                           #define play_led_seg_out() P0DIR &= ~(BIT(5)) ;P0PU |= (BIT(5)); 
                         #define PLAY_STATUS_PORT  P05
    #define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0

	
      #elif defined(DCX_HCC001_G)//#ifdef 

                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(2) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P02  =1//P34=1//
                         #define MUTE_PORT_LOW()			P02  =0//	P34  =0//                        
                           #define play_led_seg_out()  DACCON0|=0x40;P2DIR &= ~(BIT(4));P2PU |= (BIT(4)); 
                         #define PLAY_STATUS_PORT P24
    #define iic_data_out()    P0DIR &= ~(1);P0PU |= (1) ;
    #define iic_data_in()     P0DIR |= (1);P0PU |= (1);
    #define iic_data_r()      P00
    #define iic_data_h()      P00 = 1
    #define iic_data_l()      P00 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0
      #elif defined(K071_BODA_YJ18)//#ifdef 
             #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
             #define SET_MUTE_PORT_PU() 			P2PU |= BIT(6) ///P3PU |= 0x10//                                   
            #define MUTE_PORT_HIGH()			P26  =0//P34=1//
            #define MUTE_PORT_LOW()			P26  =1//	P34  =0//


 #define play_led_seg_out()  P0DIR &= ~(BIT(1));P0PU |= (BIT(1)); 

 #define PLAY_STATUS_PORT P01
						 
                         #define iic_data_out()    P0DIR &= ~(BIT(2));P0PU |= (BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); ;
                         #define iic_data_in()     P0DIR |= (BIT(2));P0PU |= (BIT(2));
                         #define iic_data_r()      P02
                         #define iic_data_h()      P02 = 1
                         #define iic_data_l()      P02 = 0
                         
                         #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
                         #define iic_clk_h()      P01 = 1
                         #define iic_clk_l()      P01 = 0
  #elif defined(RF_MCFUN)//#ifdef 
             #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
             #define SET_MUTE_PORT_PU() 			P2PU |= BIT(6) ///P3PU |= 0x10//                                   
            #define MUTE_PORT_HIGH()			P26  =0//P34=1//
            #define MUTE_PORT_LOW()			P26  =1//	P34  =0//
                           #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= (BIT(7)); 
                         #define PLAY_STATUS_PORT P27
       #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()   P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()   P01
    #define iic_data_h()    P01 = 1
    #define iic_data_l()    P01 = 0
    
    #define iic_clk_out()   P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()   P00 = 1
    #define iic_clk_l()     P00 = 0
                       #define  aux_detect_in()      P0DIR |= BIT(5);P0PU |= BIT(5);
                       #define  AUX_DETECT_GPIO  P05
                       #define  aux_detect_in_off()      P0DIR &= ~(BIT(5));P05=0;P0PU &=~ BIT(5);// P0DIR &= ~BIT(5); //linein check port
           #define power_ctl(n)  	 P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n	
  #elif defined(RXD_2091)//#ifdef 

                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(0)) ;//P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(0) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P00 =1//P34=1//
                         #define MUTE_PORT_LOW()			P00  =0//	P34  =0//                        
                           #define play_led_seg_out()  P0DIR &= ~(BIT(1));P0PU |= (BIT(1)); 
                         #define PLAY_STATUS_PORT P01
						 
                         #define iic_data_out()    P0DIR &= ~(BIT(2));P0PU |= (BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); ;
                         #define iic_data_in()     P0DIR |= (BIT(2));P0PU |= (BIT(2));
                         #define iic_data_r()      P02
                         #define iic_data_h()      P02 = 1
                         #define iic_data_l()      P02 = 0
                         
                         #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
                         #define iic_clk_h()      P01 = 1
                         #define iic_clk_l()      P01 = 0
      #elif defined(JM818)//#ifdef 
                          #define SET_MUTE_PORT_DIR()	;//P0DIR &= ~(BIT(0)) ;//P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	;//P0PU |= BIT(0) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()		FM_SetGPIO2(0);	//P00 =1//P34=1//
                         #define MUTE_PORT_LOW()		FM_SetGPIO2(1);//P00  =0//	P34  =0//                        
                           #define play_led_seg_out()  P0DIR &= ~(BIT(0));P0PU |= (BIT(0)); 
                         #define PLAY_STATUS_PORT P00
						 
                         #define iic_data_out()    P0DIR &= ~(BIT(2));P0PU |= (BIT(2)) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); ;
                         #define iic_data_in()     P0DIR |= (BIT(2));P0PU |= (BIT(2));
                         #define iic_data_r()      P02
                         #define iic_data_h()      P02 = 1
                         #define iic_data_l()      P02 = 0
                         
                         #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
                         #define iic_clk_h()      P01 = 1
                         #define iic_clk_l()      P01 = 0                   
      #elif defined(RUITANG_005)//#ifdef 

                          #define SET_MUTE_PORT_DIR()	P0DIR &= ~(BIT(1))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P0PU |= BIT(1) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P01  =0//P34=1//
                         #define MUTE_PORT_LOW()			P01  =1//	P34  =0//                        
                           #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= (BIT(7)); 
                         #define PLAY_STATUS_PORT P27
                         #define iic_data_out()    DACCON0|=0x80; P2DIR &= ~(1<<6);P2PU |= (1<<6) ;
                         #define iic_data_in()    DACCON0|=0x80;  P2DIR |= (1<<6);P2PU |= (1<<6);
                         #define iic_data_r()      P26
                         #define iic_data_h()      P26 = 1
                         #define iic_data_l()      P26 = 0    
                         #define iic_clk_out()   DACCON0|=0x80;  P2DIR &= ~(7);P2PU |= (7);
                         #define iic_clk_h()      P27 = 1
                         #define iic_clk_l()      P27 = 0              
                         #define power_ctl(n)  	 P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n	


	        #elif defined(K583_zhuoxin)||defined(K583_JYHL)

                          #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
                         #define SET_MUTE_PORT_PU() 	P2PU |= BIT(6) ///P3PU |= 0x10//
                         #define MUTE_PORT_HIGH()			P26  =1//P34=1//
                         #define MUTE_PORT_LOW()			P26  =0//	P34  =0//                        
                           #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= (BIT(7));   P0DIR &= ~(1);P0PU |= (1);
                           #define FM_STATUS_PORT  P00                    
                         #define PLAY_STATUS_PORT P27
                         #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
                         #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
                         #define iic_data_r()      P01
                         #define iic_data_h()      P01 = 1
                         #define iic_data_l()      P01 = 0    
                         #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
                         #define iic_clk_h()      P00 = 1
                         #define iic_clk_l()      P00 = 0              
                         #define power_ctl(n)  	 P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n	

                       #define  aux_detect_in()      P2DIR |= BIT(7);P2PU |= BIT(7);
                       #define  AUX_DETECT_GPIO  P27
                       #define  aux_detect_in_off()        P2DIR &= ~BIT(7); //linein check port

						 
      #elif defined(K650_QINDEXIN)
                                     #define SET_MUTE_PORT_DIR()	DACCON0|=0x80;P2DIR &= ~(BIT(7))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
                                       #define SET_MUTE_PORT_PU() 			P2PU |= BIT(7) ///P3PU |= 0x10//
                                       #define MUTE_PORT_HIGH()			P27  =1//P34=1//
                                       #define MUTE_PORT_LOW()			P27 =0//	P34  =0//          
                                       #define play_led_seg_out() P0DIR &= ~(BIT(0));P0PU |= BIT(0); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);                  
                                       #define PLAY_STATUS_PORT P00
                                       #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
                                       #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
                                       #define iic_data_r()      P01
                                       #define iic_data_h()      P01 = 1
                                       #define iic_data_l()      P01 = 0
                                       
                                       #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
                                       #define iic_clk_h()      P00 = 1
                                       #define iic_clk_l()      P00 = 0

                       #define  aux_detect_in()      P0DIR |= BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);//linein check port
                       #define  AUX_DETECT_GPIO  P02
                       #define  aux_detect_in_off()        P0DIR &= ~BIT(2); //linein check port
    
    #define power_ctl(n)  	 DACCON0|=0x80;P2DIR &= ~(BIT(6));P2PU |= BIT(6);P26=n	

					  
      #elif defined(K678_TN893)
	#define SET_MUTE_PORT_DIR()	;//DACCON0|=0x80;P2DIR &= ~(BIT(6))  //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 		;//	P2PU |= BIT(6) ///P3PU |= 0x10//
    #define MUTE_PORT_HIGH()			;//P26  =1//P34=1//
    #define MUTE_PORT_LOW()			;//P26  =0//	P34  =0//        
   #define play_led_seg_out()    P0DIR &= ~BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define PLAY_STATUS_PORT  P02

	
    #define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1) ;
    #define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1);
    #define iic_data_r()      P01
    #define iic_data_h()      P01 = 1
    #define iic_data_l()      P01 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1);P0PU |= (1);
    #define iic_clk_h()      P00 = 1
    #define iic_clk_l()      P00 = 0				  
    #elif  defined( KL222_YDS)
     #define SET_MUTE_PORT_DIR()	P0DIR &= ~BIT(2);   P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define SET_MUTE_PORT_PU() 			P0PU |= (2);//P3PU |= 0x10//
    #define MUTE_PORT_HIGH()			P02  =1//P34=1//
    #define MUTE_PORT_LOW()			P02  =0//	P34  =0//
    #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= BIT(7); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define PLAY_STATUS_PORT P27
    
    #define iic_data_out()  DACCON0|=0x80;  P2DIR &= ~(1<<6);P2PU |= (1<<6);
    #define iic_data_in()     P2DIR |= (1<<6);P2PU |= (1<<6);
    #define iic_data_r()      P26
    #define iic_data_h()      P26 = 1
    #define iic_data_l()      P26 = 0
    
    #define iic_clk_out()    DACCON0|=0x40;P2DIR &= ~(1<<5);P2PU |= (1<<5);
    #define iic_clk_h()      P25 = 1
    #define iic_clk_l()      P25 = 0
      #elif  defined(BOPAI_201)
     #define SET_MUTE_PORT_DIR()      P0DIR &= ~0x01;    //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 		P0PU |= 0x01;
   #define MUTE_PORT_HIGH()	 P00=1;//0  =1//P34=1//
  #define MUTE_PORT_LOW()	 P00=0;//0  =0//	P34  =0//

 #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(6));P2PU |= BIT(6); //P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define PLAY_STATUS_PORT P26
    
    #define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0
      #elif  defined( SL_029)
     #define SET_MUTE_PORT_DIR()	;//IR &= ~0x01      //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 		;//PU |= 0x01//P3PU |= 0x10//
                                   #ifdef  PA_LOW_MUTE//
                                   
                                   #define MUTE_PORT_HIGH()		;//0  =0//P34=1//
                                   #define MUTE_PORT_LOW()		;//0  =1//	P34  =0//
                                   #else
                                   #define MUTE_PORT_HIGH()		;//0  =1//P34=1//
                                   #define MUTE_PORT_LOW()		;//0  =0//	P34  =0//
                                   #endif
    #define play_led_seg_out() P0DIR &= ~0x01;P0PU |= 0x01; 
    #define PLAY_STATUS_PORT P00
    
    #define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0
     #elif  defined( BI_ER209)
    
     #define SET_MUTE_PORT_DIR()	P0DIR &= ~(5);    //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 			P0PU |= (5);//P3PU |= 0x10//
    
    #define MUTE_PORT_HIGH()			P05  =1//P34=1//
    #define MUTE_PORT_LOW()			P05  =0//	P34  =0//
    //#define NO_LED_DISPLAY
    
    #define play_led_seg_out()  DACCON0|=0x80;P2DIR &= ~(BIT(7));P2PU |= BIT(7); P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define PLAY_STATUS_PORT P27
    
    #define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0
    
   #elif  defined(RS_228V)
 #define SET_MUTE_PORT_DIR()	P0DIR &=~(1<<4);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= (1<<4);//P3PU |= 0x10//
#define MUTE_PORT_HIGH()			P04  =1//P34=1//
#define MUTE_PORT_LOW()			P04 =0//	P34  =0//

    #define play_led_seg_out()   P0DIR &= ~(BIT(0));P0PU |= BIT(0); 
    #define PLAY_STATUS_PORT P00
    
    #define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0

    #else
     #define SET_MUTE_PORT_DIR()	P0DIR &= ~0x01      //P0IE &= 0xfe;//P3DIR &= ~0x10//
    #define SET_MUTE_PORT_PU() 		P0PU |= 0x01//P3PU |= 0x10//
                                   #ifdef  PA_LOW_MUTE//
                                   
                                   #define MUTE_PORT_HIGH()			P00  =0//P34=1//
                                   #define MUTE_PORT_LOW()			P00  =1//	P34  =0//
                                   #else
                                   #define MUTE_PORT_HIGH()			P00  =1//P34=1//
                                   #define MUTE_PORT_LOW()			P00  =0//	P34  =0//
                                   #endif
    #define play_led_seg_out() P0DIR &= ~0x02;P0PU |= 0x02; 
    #define PLAY_STATUS_PORT P01
   
    #define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2) ;P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
    #define iic_data_r()      P02
    #define iic_data_h()      P02 = 1
    #define iic_data_l()      P02 = 0
    
    #define iic_clk_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
    #define iic_clk_h()      P01 = 1
    #define iic_clk_l()      P01 = 0

#define power_key_detect_in()		DACCON0|=0x80; P2DIR &=~(1<<7);P2PU |= (1<<7);P27 =1;;P2DIR |= (1<<7);P2PU &= ~(1<<7);
#define POWER_KEY_PORT		P27//P34=1//
#define power_ctl(n)  			DACCON0|=0x80;P2DIR &= ~(1<<6);P2PU |= (1<<6);P26 = n

        #endif

#ifdef  K650_zhuoxing
#define power_key_detect_in()		DACCON0|=0x40; P2DIR &=~(1<<4);P24 =1;P2DIR |= (1<<4);P2PU &= ~(1<<4);
#define POWER_KEY_PORT		P24//P34=1//
#define power_ctl(n)  			DACCON0|=0x40;P2DIR &= ~(1<<5);P2PU |= (1<<5);P25 = n
#endif

#ifdef KL202_WS_01
#define Stasus_led_out() DACCON0|=0x40;P2DIR &= ~(BIT(4)|BIT(5));P2PU |= (BIT(4)|BIT(5));
#define MP3_SD_STATUS_PORT P24
#define FM_STATUS_PORT  P25
#endif

#ifdef  USE_IO_SWITCH_AP_MOD
#ifdef MP3_FM_SWITCH_PORT_P27
#define  MP3_FM_SWITCH_PORT_OUT()    P2DIR &= ~(BIT(7));P2PU |= BIT(7);
#define MP3_FM_SWITCH_PORT  P27
#endif
#ifdef MP3_FM_SWITCH_PORT_02
#define  MP3_FM_SWITCH_PORT_OUT()    P0DIR &= ~(BIT(2));P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4);
#define MP3_FM_SWITCH_PORT  P02
#endif
#endif

#ifdef JOG_KEY
#define JOG_detect_in() P2DIR |= 0xC0;P2PU |= 0xC0;               //P26,P27
#define JOG_PORT  P2
#endif


#define led_com_out() P3DIR &= ~0x1F; P3PU |= 0x1F;P3HD|= 0x1F;
#define led_seg_out() P1DIR &= ~0x7F;P1PU |= 0x7F; 

#define LED_COM1   P30
#define LED_COM2   P31
#define LED_COM3   P32
#define LED_COM4   P33
#define LED_COM5   P34
#define LED_COM    P3
#define LED_SEG    P1

#define ADC_KEY_IO     0x4f
#define ADC_VDD_12     0x48
#define ADC_LDOIN      0x49
#define ADC_AUDIO     0x4C
#define ADC_MAX_USED 0x03

#else

 #ifdef POWER_SAVE_SYSTEM
///ac209 48pin
#ifdef POWER_POWRE_KEY_P02	
#define power_key_detect_in()		 P0DIR |=(1<<2); P0PU &=~(1<<2);P0PD|=(1<<2);      //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define POWER_KEY_PORT		P02//P34=1//
#elif defined(POWER_POWRE_KEY_P01)
#define power_key_detect_in()		 P0DIR |=(1<<1); P0PU &=~(1<<1);P0PD|=(1<<1);      //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define POWER_KEY_PORT		P02//P34=1//
#elif defined(POWER_POWRE_KEY_P04)
#define power_key_detect_in()		 P0DIR |=(1<<4); P0PU &=~(1<<4);P0PD|=(1<<4);      //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define POWER_KEY_PORT		P04//P34=1//
#endif
#ifdef POWER_CTL_P10	
#define power_ctl(n)  P1DIR &= ~0x01 ;P0PU |= 0x01;P10 = n
#elif defined( POWER_CTL_P17)	
#define power_ctl(n)   P1DIR &=~(1<<7); P1PU|=(1<<7);  P17 = n
#elif defined( POWER_CTL_P04)	
#define power_ctl(n)   P0DIR &=~(1<<4); P0PU|=(1<<4);  P04 = n
#elif defined( POWER_CTL_WAKP)	
#define power_ctl(n)   P0DIR &=~(1<<4); P0PU|=(1<<4);  P04 = n
#elif defined( POWER_CTL_P02)	
#define power_ctl(n)   P0DIR &=~(1<<2); P0PU|=(1<<2);  P02 = n
#else
#define power_ctl(n)   P0DIR &=~(1<<1); P0PU|=(1<<1);  P01= n
#endif
#endif

#ifdef MUTE_PORT_USE_P00
 #define SET_MUTE_PORT_DIR()	P0DIR &= ~0x01      //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= 0x01//P3PU |= 0x10//
               #ifdef  PA_LOW_MUTE//
               #define MUTE_PORT_HIGH()			P00  =0//P34=1//
               #define MUTE_PORT_LOW()			P00  =1//	P34  =0//
               #else
               #define MUTE_PORT_HIGH()			P00  =1//P34=1//
               #define MUTE_PORT_LOW()			P00  =0//	P34  =0//
               #endif
#elif defined(MUTE_PORT_USE_P04)
 #define SET_MUTE_PORT_DIR()	P0DIR &=~(1<<4);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= (1<<4);//P3PU |= 0x10//
                #ifdef  PA_LOW_MUTE//
               #define MUTE_PORT_HIGH()			P04  =0//P34=1//
               #define MUTE_PORT_LOW()			P04 =1//	P34  =0//
               #else
               #define MUTE_PORT_HIGH()			P04  =1//P34=1//
               #define MUTE_PORT_LOW()			P04 =0//	P34  =0//
               #endif
#elif defined(MUTE_PORT_USE_P03)
 #define SET_MUTE_PORT_DIR()	P0DIR &=~(1<<3);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= (1<<3);//P3PU |= 0x10//
                #ifdef  PA_LOW_MUTE//
               #define MUTE_PORT_HIGH()			P03  =0//P34=1//
               #define MUTE_PORT_LOW()			P03 =1//	P34  =0//
               #else
               #define MUTE_PORT_HIGH()			P03  =1//P34=1//
               #define MUTE_PORT_LOW()			P03 =0//	P34  =0//
               #endif
#elif defined(MUTE_PORT_USE_P02)
 #define SET_MUTE_PORT_DIR()	       P0DIR &=~(1<<2);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= (1<<2);//P3PU |= 0x10//
                #ifdef  PA_LOW_MUTE//
               #define MUTE_PORT_HIGH()			P02  =0//P34=1//
               #define MUTE_PORT_LOW()			P02 =1//	P34  =0//
               #else
               #define MUTE_PORT_HIGH()			P02  =1//P34=1//
               #define MUTE_PORT_LOW()			P02 =0//	P34  =0//
               #endif
#elif defined(MUTE_PORT_USE_P01)
 #define SET_MUTE_PORT_DIR()	P0DIR &=~(1<<1);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= (1<<1);//P3PU |= 0x10//
                #ifdef  PA_LOW_MUTE//
               #define MUTE_PORT_HIGH()			P01  =0//P34=1//
               #define MUTE_PORT_LOW()			P01 =1//	P34  =0//
               #else
               #define MUTE_PORT_HIGH()			P01  =1//P34=1//
               #define MUTE_PORT_LOW()			P01 =0//	P34  =0//
               #endif
#elif defined(MUTE_PORT_USE_P17)
 #define SET_MUTE_PORT_DIR()	P1DIR &=~(1<<7);   //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P1PU |= (1<<7);//P3PU |= 0x10//
#define MUTE_PORT_HIGH()			P17  =1//P34=1//
#define MUTE_PORT_LOW()			P17 =0//	P34  =0//
#else
#define SET_MUTE_PORT_DIR()		P0DIR &= ~0x02      //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_MUTE_PORT_PU() 			P0PU |= 0x02//P3PU |= 0x10//

           #ifdef  PA_LOW_MUTE//
           #define MUTE_PORT_HIGH()			P01 =0//P34=1//
           #define MUTE_PORT_LOW()			P01  =1//	P34  =0//
           #else
           #define MUTE_PORT_HIGH()			P01  =1//P34=1//
           #define MUTE_PORT_LOW()			P01  =0//	P34  =0//
           #endif
#endif

#ifdef  AUDIO_LED_FLASH
#if  defined(LED_ROLLING_COM6_P17)
#define   LED_COM6_init()        P1DIR &= ~(1<<7);P1PU |= BIT(7);
#define  LED_COM6  P17
#elif  defined(LED_ROLLING_COM6_P34)
#define   LED_COM6_init()        P3DIR &= ~(1<<4);P3PU |= BIT(4);
#define  LED_COM6  P34
#else
#define   LED_COM6_init()        P0DIR &= ~(1<<2);P0PU |= BIT(2);
#define  LED_COM6  P02
#endif
#endif

#if( LED_TYPE==LED_4X8888||LED_TYPE==LED_RT_4X8888)
#define led_com_out() P3DIR &= ~0x0F; P3PU |= 0x0F; P3HD|= 0x0F;
#else
#define led_com_out() P3DIR &= ~0x1F; P3PU |= 0x1F;P3HD|= 0x1F;
#endif
#define led_seg_out() P1DIR &= ~0xFF;P1PU |= 0xFF; 

#define LED_COM1   P30
#define LED_COM2   P31
#define LED_COM3   P32
#define LED_COM4   P33
#ifdef LED_COM5_P17
#define LED_COM5   P17
#else
#define LED_COM5   P34
#endif
#define LED_COM    P3
#define LED_SEG    P1


#ifdef   K097_ZHENGYANG_XX
#define Stasus_led_out() P1DIR &= ~0x07;P1PU |= 0x07; 
#define MP3_STATUS_PORT P10
#define FM_STATUS_PORT  P11
#define AUX_STATUS_PORT P12
#endif

#ifdef  USE_IO_COTROL_FM_POWER
#ifdef  FM_POWER_IO_P00  
#define  Fm_Power_Out()  P0DIR &= ~0x01;P0PU |= 0x01; 
#define  FM_POWER_PORT  P00
#define  FM_POWER_ON()    P00 = 0;
#define  FM_POWER_OFF()  P00 = 1;
#endif
#endif

#ifdef   K099_YONGHUI
#define Stasus_led_out() P1DIR &= ~0x07;P1PU |= 0x07; 
#define MP3_SD_STATUS_PORT P10
#define FM_STATUS_PORT  P11
#define AUX_STATUS_PORT P12
#endif

#ifdef  GW337_AC2092
#define Stasus_led_out() P3DIR &= ~0x03;P3PU |= 0x03; 
#define USB_STATUS_PORT P31
#define SD_STATUS_PORT  P30
#endif

#ifdef JOG_KEY
#if  defined(K1130_HONGSHENG)||defined(K1130_BHT_V001)
#define JOG_detect_in() P0DIR |= 0x18;P0PU |= 0x18; 
#define JOG_PORT  P0
#else
#define JOG_detect_in() P1DIR |= 0xC0;P1PU |= 0xC0; 
#define JOG_PORT  P1
#endif
#endif

 #if defined(K608_YDS)

 #define play_led_seg_out()  P0DIR &= ~0x80;P0PU |= 0x80;  P0DIR &= ~BIT(2);P0PU |= BIT(2);
#define FM_STATUS_PORT  P02
#define PLAY_STATUS_PORT P07
 #elif defined(OK_516B)

 #define play_led_seg_out()  P1DIR &= ~(BIT(7)|BIT(1)|BIT(3));P1PU |= BIT(7)|BIT(1)|BIT(3);  
#define FM_STATUS_PORT  P13
#define PLAY_STATUS_PORT P11
#define CHARGE_STATUS_PORT P17

 #elif defined(CONGWEI_WHT_017)
#define play_led_seg_out() P1DIR &= ~0x01;P0PU |= 0x01; 
#define PLAY_STATUS_PORT P10
 #elif defined(PLAY_STATUS_LED_P06)
#define play_led_seg_out() P0DIR &= ~BIT(6);P0PU |= BIT(6); 
#define PLAY_STATUS_PORT P06
 #elif defined(PLAY_STATUS_LED_P03)
#define play_led_seg_out() P0DIR &= ~(BIT(3));P0PU |= BIT(3); 
#define PLAY_STATUS_PORT P03
 #elif defined(PLAY_STATUS_LED_P04)
#define play_led_seg_out() P0DIR &= ~(BIT(4));P0PU |= BIT(4); 
#define PLAY_STATUS_PORT P04
 #elif defined(PLAY_STATUS_LED_P00)
 #define play_led_seg_out() P0DIR &= ~0x01;P0PU |= 0x01; 
#define PLAY_STATUS_PORT P00
 #elif defined(PLAY_STATUS_LED_P17)
#define play_led_seg_out() P1DIR &= ~0x80;P1PU |= 0x80; 
#define PLAY_STATUS_PORT P17
#else
#define play_led_seg_out() P0DIR &= ~0x80;P0PU |= 0x80; 
#define PLAY_STATUS_PORT P07
#endif

#ifdef CONGWEI_RC_CA5 
#define  EARPHONE_DETECT_GPIO  P04
#define  earphone_detect_in()  P0DIR &=~BIT(2);P0PU &= ~BIT(2); P0DIR |= BIT(4);P0PU &= ~BIT(4);  if(P04) P02=0;else P02=1;
#elif defined( EARPHONE_PLUGGED_USE_P02)
#define  EARPHONE_DETECT_GPIO  P02
#define  earphone_detect_in()  P0DIR |=BIT(2);P0PU |= BIT(2); 
#elif defined( EARPHONE_PLUGGED_USE_P15)
#define  EARPHONE_DETECT_GPIO  P15
#define  earphone_detect_in()  P1DIR |=BIT(5);P1PU |= BIT(5); 
#elif defined( EARPHONE_PLUGGED_USE_P17)
#define  EARPHONE_DETECT_GPIO  P17
#define  earphone_detect_in()  P1DIR |=BIT(7);P1PU|= BIT(7); 
#elif  defined( EARPHONE_PLUGGED_USE_P03)
#define  EARPHONE_DETECT_GPIO  P03
#define  earphone_detect_in()  P0DIR |=BIT(3);P0PU|= BIT(3); 
#elif  defined( EARPHONE_PLUGGED_USE_P04)
#define  EARPHONE_DETECT_GPIO  P04
#define  earphone_detect_in()  P0DIR |=BIT(4);P0PU|= BIT(4); 
#elif  defined( EARPHONE_PLUGGED_USE_P33)
#define  EARPHONE_DETECT_GPIO  P33
#define  earphone_detect_in()  P3DIR |=BIT(3);P3PU|= BIT(3); 
#elif  defined( EARPHONE_PLUGGED_USE_P34)
#define  EARPHONE_DETECT_GPIO  P34
#define  earphone_detect_in()  P3DIR |=BIT(4);P3PU|= BIT(4); 
#else
#define  EARPHONE_DETECT_GPIO  P07
#define  earphone_detect_in()   P0DIR |= 0x80;P0PU|= 0x80; 
#define  earphone_detect_port_low()   P0DIR &= ~0x80;P0PD|= 0x80; EARPHONE_DETECT_GPIO=0;
#endif

#ifdef  LINE_IN_DETECT_USE_P01
#define  aux_detect_in()      P0DIR |= BIT(1);P0PU |= BIT(1);//linein check port
#define  AUX_DETECT_GPIO  P01
#define  aux_detect_in_off()        P0DIR &= ~BIT(1); //linein check port
#elif defined(LINE_IN_DETECT_USE_P33)
#define  aux_detect_in()      P3DIR |= BIT(3);P3PU |= BIT(3);//linein check port
#define  AUX_DETECT_GPIO  P33
#define  aux_detect_in_off()        P3DIR &= ~BIT(3); //linein check port
#elif defined(LINE_IN_DETECT_USE_P34)
#define  aux_detect_in()      P3DIR |= BIT(4);P3PU |= BIT(4);//linein check port
#define  AUX_DETECT_GPIO  P34
#define  aux_detect_in_off()        P3DIR &= ~BIT(4); //linein check port
#elif defined(LINE_IN_DETECT_USE_P02)
#define  aux_detect_in()      P0DIR |= BIT(2);P0PU |= BIT(2);//linein check port
#define  AUX_DETECT_GPIO  P02
#define  aux_detect_in_off()        P0DIR &= ~BIT(2); //linein check port
#elif defined(LINE_IN_DETECT_USE_P06)
#define  aux_detect_in()      P0DIR |= BIT(6);P0PU |= BIT(6);//linein check port
#define  AUX_DETECT_GPIO  P06
#define  aux_detect_in_off()        P0DIR &= ~BIT(6); //linein check port
#elif defined(K1015_ANJIER)||defined(K1015_FUWEI)||defined(K1015_JIAMEI)||defined(FW12_FUWEI)||defined(K1015_FUWEI_WK_H5)||defined(K3100_WK_H5)||defined(K1015_HF_XMD_028)
#define  aux_detect_in()      P0DIR |= BIT(7);P0PU |= BIT(7);//linein check port
#define  AUX_DETECT_GPIO  P07
#define  aux_detect_in_off()        P0DIR &= ~BIT(7); P07=0;//linein check port
#elif defined(LINE_IN_DETECT_USE_P07)
#define  aux_detect_in()      P0DIR |= BIT(7);P0PU |= BIT(7);//linein check port
#define  AUX_DETECT_GPIO  P07
#define  aux_detect_in_off()        P0DIR &= ~BIT(7); //linein check port
#elif defined(LINE_IN_DETECT_USE_P13)
#define  aux_detect_in()      P1DIR |= BIT(3);P1PU |= BIT(3);//linein check port
#define  AUX_DETECT_GPIO  P13
#define  aux_detect_in_off()        P1DIR &= ~BIT(3); //linein check port
#elif defined(LINE_IN_DETECT_USE_P17)
#define  aux_detect_in()      P1DIR |= BIT(7);P1PU |= BIT(7);//linein check port
#define  AUX_DETECT_GPIO  P17
#define  aux_detect_in_off()        P1DIR &= ~BIT(7); //linein check port
#elif defined(LINE_IN_DETECT_USE_P03)
#define  aux_detect_in()      P0DIR |= BIT(3);P0PU |= BIT(3);//linein check port
#define  AUX_DETECT_GPIO  P03
#define  aux_detect_in_off()        P0DIR &= ~(BIT(3)); //linein check port
#elif defined(LINE_IN_DETECT_USE_P04)
#define  aux_detect_in()      P0DIR |= BIT(4);P0PU |= BIT(4);//linein check port
#define  AUX_DETECT_GPIO  P04
#define  aux_detect_in_off()        P0DIR &= ~BIT(4); //linein check port
#endif


#ifdef I2C_USE_POO_P01_PORT
#define iic_data_out()    P0DIR &= ~(1<<1);P0PU |= (1<<1)
#define iic_data_in()     P0DIR |= (1<<1);P0PU |= (1<<1)
#define iic_data_r()      P01
#define iic_data_h()      P01 = 1
#define iic_data_l()      P01 = 0
#define iic_clk_out()    P0DIR &= ~(1<<0);P0PU |= (1<<0)
#define iic_clk_h()      P00= 1
#define iic_clk_l()      P00 = 0
#else
#define iic_data_out()    P0DIR &= ~(1<<2);P0PU |= (1<<2)
#define iic_data_in()     P0DIR |= (1<<2);P0PU |= (1<<2)
#define iic_data_r()      P02
#define iic_data_h()      P02 = 1
#define iic_data_l()      P02 = 0
#define iic_clk_out()    P0DIR &= ~(1<<3);P0PU |= (1<<3)
#define iic_clk_h()      P03 = 1
#define iic_clk_l()      P03 = 0
#endif


 #ifdef AD_KEY_USE_P07
#define ADC_KEY_IO     0x4f
#else
#define ADC_KEY_IO     0x4e

#endif
#define ADC_VDD_12     0x48
#define ADC_LDOIN      0x49
#define ADC_AUDIO     0x4C
#define ADC_MAX_USED 0x03

#ifdef  K533_DATENG

#define V_UP_LED_PORT(n)			P1DIR &= ~(1<<4);P1PU |= (1<<4);P14  =n//P34=1//
#define V_DN_LED_PORT(n)		      P1DIR &= ~(1<<5);P1PU |= (1<<5);P15  =n//	P34  =0//
#endif
#ifdef  K029_YJH_A
#define SET_LIGHT_PORT_DIR()		P0DIR &= ~0x01      //P0IE &= 0xfe;//P3DIR &= ~0x10//
#define SET_LIGHT_PORT_PU() 			P0PU |= 0x01//P3PU |= 0x10//
#define LIGHT_PORT_HIGH()			P00  =1//P34=1//
#define LIGHT_PORT_LOW()			P00  =0//	P34  =0//
#define LIGHT_STATUS_PORT   P00
#endif

#endif


#ifdef ENANLE_3008_PA
#ifdef CONGWEI_WHT_017
#define  AP_3008MODE_SWITCH(n)  P3DIR &=~(BIT(0)|BIT(3));   P30=0; delay_10ms(2);P33 = n;delay_10ms(30);P30=1; 
#elif defined( CONGWEI_WHT_019)
#define  AP_3008MODE_SWITCH(n) P0DIR &=~BIT(4); P3DIR &=~BIT(0);   P30=0; delay_10ms(2);P04 = n;delay_10ms(30);P30=1; 
#else
#define  AP_3008MODE_SWITCH(n)  P0DIR &=~(BIT(4)|BIT(2));   P02=0; delay_10ms(2);P04 = n;delay_10ms(30);P02=1; 
#endif
#endif

#ifdef  USE_4263_AP
#define  AP_4263_D_MOD()   SET_MUTE_PORT_DIR();SET_MUTE_PORT_PU();MUTE_PORT_HIGH();Delay_us(6);MUTE_PORT_LOW();Delay_us(2);MUTE_PORT_HIGH();Delay_us(7);MUTE_PORT_LOW();
#define  AP_4263_AB_MOD()   SET_MUTE_PORT_DIR();SET_MUTE_PORT_PU();MUTE_PORT_HIGH();Delay_us(6);MUTE_PORT_LOW();
#define  AP_4263_OFF_MOD()   SET_MUTE_PORT_DIR();MUTE_PORT_HIGH();
#endif

#ifdef CHARGR_DET_USER_VPP
  #define  charge_detect_in()      WKUPPND &=~ (1<<6); //P0DIR |= BIT(4);P0PU |= BIT(4);//linein check port
  #elif defined(CHARGR_DET_USE_P01)
 #define  charge_detect_in()       P0DIR |= BIT(1);P0PD|= BIT(1);
  #define  charge_status_port       P01
    #elif defined(CHARGR_DET_USE_P17)
 #define  charge_detect_in()       P1DIR |= BIT(7);P1PDA|= BIT(7);//P1PDA|= BIT(7);
  #define  charge_status_port       P17
  #elif defined(CHARGR_DET_USE_P02)
 #define  charge_detect_in()       P0DIR |= BIT(2);P0PD|= BIT(2);
  #define  charge_status_port       P02
    #elif defined(CHARGR_DET_USE_P07)
 #define  charge_detect_in()       P0DIR |= BIT(7);P0PD|= BIT(7);
  #define  charge_status_port       P07
#else
 #define  charge_detect_in()       P0DIR |= BIT(4);P0PD|= BIT(4);
  #define  charge_status_port       P04
 #endif

#if defined(GBT_2092)
        #define GBT_ctl(n)      P0DIR &= ~BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n;
#endif 

#if defined(SWD_2098)
  #define  LED_COM7_init()    P0DIR &= ~(BIT(0)|BIT(1));P0PU |= BIT(0)|BIT(1);
  #define  LED_COM67  P0
#endif


 #if  defined(HYF_AC2096)||defined(HYF_731_AC2091_V001)
 #define HYF_ctl(n)      P0DIR &= ~BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n;
 #endif

 #ifdef RUITANG_XSZ
  #define  KEY_detect_in()       P0DIR |= BIT(1);P0PU|= BIT(1);
  #define  key_status_port       P01
 #endif


#ifdef   JYHL_SP_101c
 #define LED_ctl(n)   P1DIR =0;P1PU = 0;  P3DIR &=~0X1F;P3PU |=0X1F; P3=0;P1=0;   if(n==1) {P10=1;P15=1;}  else if(n==2) {P11=1;P16=1;} else if(n==3) {P12=1;P30=1;}else if(n==4) {P13=1;P31=1;} else if(n==5) {P14=1;P32=1;}
#endif

 #ifdef ZW_MD_20
 #define PH_ctl(n)      P0DIR &= ~BIT(2);P0PU |= BIT(2);P3DIR |= (1<<4);P3PU &=~ (1<<4);P3PD&=~ (1<<4); P02=n;

  #elif defined(OK_516B)

#define PH_ctl(n)      P1DIR &= ~BIT(4);P1PU |= BIT(4);P14=n;
 #endif

#ifdef  EN_ELECTRIC_TORCH
 #ifdef EN_ELECTRIC_TORCH_PORT_P26
 #define ELECTRIC_TORCH_LED_PORT_OUT() DACCON0|=0x80;P2DIR &= ~(BIT(6));P2PU |= BIT(6); 
#define LECTRIC_TORCH_LED_PORT  P26
#elif  defined(EN_ELECTRIC_TORCH_PORT_P17)
 #define ELECTRIC_TORCH_LED_PORT_OUT() DACCON0|=0x80;P1DIR &= ~(BIT(7));P1PU |= BIT(7); 
#define LECTRIC_TORCH_LED_PORT  P17
 #else
 #define ELECTRIC_TORCH_LED_PORT_OUT() P0DIR &= ~BIT(4);P0PU |= BIT(4);
#define LECTRIC_TORCH_LED_PORT  P04
#endif
#endif

#ifdef  USE_IO_SWITCH_AP_MOD
#ifdef MP3_FM_SWITCH_PORT_P07
#define  MP3_FM_SWITCH_PORT_OUT()    P0DIR &= ~(BIT(7));P0PU |= BIT(7);
#define MP3_FM_SWITCH_PORT  P07
#elif   defined(MP3_FM_SWITCH_PORT_P06)
#define  MP3_FM_SWITCH_PORT_OUT()    P0DIR &= ~(BIT(6));P0PU |= BIT(6);
#define MP3_FM_SWITCH_PORT  P06
#elif   defined(MP3_FM_SWITCH_PORT_P17)
#define  MP3_FM_SWITCH_PORT_OUT()    P1DIR &= ~(BIT(7));P1PU |= BIT(7);
#define MP3_FM_SWITCH_PORT  P17
#elif   defined(MP3_FM_SWITCH_PORT_P04)
#define  MP3_FM_SWITCH_PORT_OUT()    P0DIR &= ~(BIT(4));P0PU |= BIT(4);
#define MP3_FM_SWITCH_PORT  P04
#endif
#endif

#ifdef  USE_IO_CONT_V
#define  V_cont_port_out()    P1DIR &= ~(BIT(7));P1PU |= BIT(7);
#define V_CONT_PORT  P17
#endif

#ifdef  USE_GPIO_DETECT_MIC
#ifdef  MIC_IN_DETECT_USE_P04
 #define  MIC_IN_DETECT_PORT_IN()    P0DIR |= BIT(4);
  #define  MIC_IN_DETECT_PORT       P04
#endif
#endif

#ifdef USE_IO_CONT_BULE
#if defined(K1151_SHIJUE)||defined(K1227_SW)
#define Blue_key_out()     P1DIR &= ~(BIT(0)|BIT(1)|BIT(2));P1PU |= BIT(0)|BIT(1)|BIT(2);
#define BLUE_PLAY_KEY_PORT  P10
#define BLUE_NEXT_KEY_PORT   P12
#define BLUE_PREV_KEY_PORT  P11
#elif defined(K1198_MY)
#define Blue_key_out()     P1DIR &= ~(BIT(5)|BIT(6)|BIT(7));P1PU |= BIT(5)|BIT(6)|BIT(7);
#define BLUE_PLAY_KEY_PORT  P17
#define BLUE_NEXT_KEY_PORT   P16
#define BLUE_PREV_KEY_PORT  P15
#endif
#endif

#ifdef  USE_GPIO_COTR_BUL_V
#define Blue_v_cot_out()     P0DIR &= ~(BIT(4));P0PU |= BIT(4);
#define Blue_V_CON_OUT_PORT  P04
#endif



